package com.fmsz.physicalheadline.entity.news;


import android.databinding.ObservableInt;

import com.fmsz.physicalheadline.BR;
import com.fmsz.physicalheadline.R;
import com.fmsz.physicalheadline.adapter.news.PagerRvAdapter;
import com.google.gson.annotations.Expose;

import java.util.List;

/**
 * Created by Administrator on 2016/12/16.
 * banners  封装实体类
 */
public class BannersEntity {
    private List<NewsBanners> newsBannerses;
//    @Expose(serialize = false,deserialize = false)
    private PagerRvAdapter adapter;
    @Expose(serialize = false, deserialize = false)
    private ObservableInt currentPage = new ObservableInt(0);

    public ObservableInt getCurrentPage() {
        return currentPage;
    }

    public PagerRvAdapter getAdapter() {
        if (adapter==null) {
            adapter = new PagerRvAdapter<>(R.layout.news_pager_item,newsBannerses, BR.image);
        }
        return adapter;
    }

    public BannersEntity(List<NewsBanners> newsBannerses) {
        this.newsBannerses = newsBannerses;
    }

    public List<NewsBanners> getNewsBannerses() {
        return newsBannerses;
    }

    public void setNewsBannerses(List<NewsBanners> newsBannerses) {
        this.newsBannerses = newsBannerses;
    }
}
